﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace DatabaseToCode
{
    /// <summary>
    /// 
    /// </summary>
    public class InputInformations : INotifyPropertyChanged
    {
        private string providerName;
        private string connectionString;
        private string @namespace;
        private string outputDirectory;
        private string contextName;

        /// <summary>
        /// Gets or sets the name of the provider.
        /// </summary>
        /// <value>
        /// The name of the provider.
        /// </value>
        public string ProviderName {
            get { return this.providerName; }
            set { 
                if (!value.Equals(this.providerName)) {
                    this.providerName = value;
                    this.OnPropertyChanged("ProviderName");
                }
            }
        }

        /// <summary>
        /// Gets or sets the connection string.
        /// </summary>
        /// <value>
        /// The connection string.
        /// </value>
        public string ConnectionString {
            get { return this.connectionString; }
            set {
                if (!value.Equals(this.connectionString)) {
                    this.connectionString = value;
                    this.OnPropertyChanged("ConnectionString");
                }
            }
        }

        /// <summary>
        /// Gets or sets the namespace.
        /// </summary>
        /// <value>
        /// The namespace.
        /// </value>
        public string Namespace { 
            get { return this.@namespace; }
            set {
                if (!value.Equals(this.@namespace))
                {
                    this.@namespace = value;
                    this.OnPropertyChanged("Namespace");
                }
            }
        }

        /// <summary>
        /// Gets or sets the name of the context.
        /// </summary>
        /// <value>
        /// The name of the context.
        /// </value>
        public string ContextName {
            get { return this.contextName; }
            set
            {
                if (!value.Equals(this.contextName))
                {
                    this.contextName = value;
                    this.OnPropertyChanged("ContextName");
                }
            }
        }

        /// <summary>
        /// Gets or sets the output directory.
        /// </summary>
        /// <value>
        /// The output directory.
        /// </value>
        public string OutputDirectory {
            get { return this.outputDirectory; }
            set
            {
                if (!value.Equals(this.outputDirectory))
                {
                    this.outputDirectory = value;
                    this.OnPropertyChanged("OutputDirectory");
                }
            }
        }

        /// <summary>
        /// Occurs when a property value changes.
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// Called when [property changed].
        /// </summary>
        /// <param name="propertyName">Name of the property.</param>
        protected virtual void OnPropertyChanged(string propertyName) {
            if (this.PropertyChanged != null) {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
